package com.googlecode.flieriya.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.googlecode.flieriya.dao.IClusterDao;
import com.googlecode.flieriya.entity.Cluster;

@Service
public class ClusterService implements IClusterService{

	@Autowired
	private IClusterDao clusterDao;

	@Override
	public List<Cluster> getAllClusters() {
		return clusterDao.getAll();
	}

	@Override
	@Transactional
	public void addCluster(String name) {
		Cluster cluster = new Cluster(name);
		clusterDao.create(cluster);
	}
	
	
}
